/**
 * 
 */
package uy.com.pzit.core.generator;

import java.util.ArrayList;
import java.util.Collections;

/**
 * @author pferraz
 * 
 */
public class RandomListNumberGenerator {

	private ArrayList<Integer> numbersList = new ArrayList<Integer>();
	private int position;

	public RandomListNumberGenerator(int length) {
		this.position = 0;
		for (int x = 0; x < length; x++) {
			numbersList.add(Integer.valueOf(x));
		}
		Collections.shuffle(numbersList);
	}


	public Integer next() {
		int value=numbersList.get(position);
		position++;
		return value;
	}

}
